﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text.RegularExpressions;

public partial class Language : PageBase
{
    protected static Regex rex = new Regex("^/([a-zA-Z]{2,2}-[a-zA-Z]{2,3})");
    protected string URI = "";

    protected void Page_Load(object sender, EventArgs e)
    {
        var uri = Request.UrlReferrer != null ? Request.UrlReferrer.PathAndQuery : "";
        if (!string.IsNullOrWhiteSpace(uri))
        {
            uri = rex.Replace(uri, "", 1);
            if (!string.IsNullOrWhiteSpace(uri))
            {
                this.URI = uri;
            }
        }
    }
}